package com.yhy.server.service;

import com.yhy.dubbo.api.mongo.UserLocationApi;
import com.yhy.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service
public class BaiduService {

    @Reference
    private UserLocationApi userLocationApi;

    public ResponseEntity saveLocation(Double latitude, Double longitude, String address) {
        //一般在service包装实体类 因为GeoJsonPoing不支持序列化
        Long userId = UserHolder.getUserId();
        userLocationApi.save(latitude,longitude,address,userId);
        return ResponseEntity.ok(null);
    }
}
